/***************************************************************************
 * Copyright (C) 2005 Global Biodiversity Information Facility Secretariat.
 * All Rights Reserved.
 *
 * The contents of this file are subject to the Mozilla Public
 * License Version 1.1 (the "License"); you may not use this file
 * except in compliance with the License. You may obtain a copy of
 * the License at http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS
 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 * implied. See the License for the specific language governing
 * rights and limitations under the License.
 ***************************************************************************/
package org.gbif.agi.model.dto;

import java.util.LinkedList;
import java.util.List;

/**
 * A DTO to allow for nested tree transfer
 * @author trobertson
 */
public class TaxonDetail implements Comparable<TaxonDetail> {
	private long id;
	private String name;
	private Long left;
	private Long right;
	private List<TaxonDetail> children = new LinkedList<TaxonDetail>();
	public TaxonDetail(long id, String name, Long left, Long right) {
		super();
		this.id = id;
		this.name = name;
		this.left = left;
		this.right = right;
	}
	public TaxonDetail() {
	}
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public List<TaxonDetail> getChildren() {
		return children;
	}
	public void setChildren(List<TaxonDetail> children) {
		this.children = children;
	}
	public Long getLeft() {
		return left;
	}
	public void setLeft(Long left) {
		this.left = left;
	}
	public Long getRight() {
		return right;
	}
	public void setRight(Long right) {
		this.right = right;
	}
	public int compareTo(TaxonDetail o) {
		return name.compareTo(o.getName());
	}
}
